package com.chtw.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.chtw.dao.TeacherDAO;
import com.chtw.entity.Teacher;
import com.chtw.entity.TeacherInfo;
import com.chtw.service.TeacherService;

@Controller
public class TeacherContriller {

	@Autowired
	private TeacherDAO teachDAO;
	
	@Autowired
	private TeacherService teacherService;
	
	@RequestMapping("/index")
	public String goindex() {
		return "index";
	}
	
	@RequestMapping("/getTeacher")
	public String getA(Model model) {
		List<TeacherInfo> tList = teacherService.getAll();
		model.addAttribute("tList",tList);
		return "index";
	}
	
	
}
